﻿@{
    ViewBag.Title = @ViewBag.Title;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model List<ProjectDeal.Models.Deal>
@section header{
    <link href="@Url.Content("~/Scripts/ProductStyle/cssproduct.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/CountDown/jquery.countdown.js")"></script>
<script src="@Url.Content("~/Scripts/CountDown/jquery.countdown-vi.js")"></script>
<link href="@Url.Content("~/Scripts/CountDown/jquery.countdown.css")" rel="stylesheet" />
}

<div class="content-wrap">
            	<div style="clear:both; display:block; height:20px"></div>
               <div id="featured">
                    <div class="camera_wrap camera_emboss " id="camera_wrap_1">
                    <div data-thumb="images/slides/thumbs/bridge.jpg" data-src="../../Content/images/featured/featured-1.jpg">
                        <div class="camera_caption moveFromLeft">
                            <h2>Awesome Responsive Online Store</h2>
                            <p>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                            <div class="button">
                              <a href="cart.html">View Cart</a>
                              <a href="checkout.html">Checkout</a>
                            </div>
                        </div>
                    </div>

                    <div data-thumb="images/slides/thumbs/leaf.jpg" data-src="../../Content/images/featured/featured-2.jpg">
                        <div class="camera_caption moveFromLeft">
                            <h2>You can Order Through You Mobile Phone</h2>
                            <p>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                            <div class="button">
                              <a href="cart.html">View Cart</a>
                              <a href="checkout.html">Checkout</a>
                            </div>
                        </div>
                    </div>
                    <div data-thumb="images/slides/thumbs/road.jpg" data-src="../../Content/images/featured/featured-3.jpg">
                        <div class="camera_caption moveFromLeft">
                            <h2>Compatible in any Browsers</h2>
                            <p>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                            <div class="button">
                              <a href="cart.html">View Cart</a>
                              <a href="checkout.html">Checkout</a>
                            </div>
                        </div>
                    </div>
                    <div data-thumb="images/slides/thumbs/road.jpg" data-src="../../Content/images/featured/featured-4.jpg">
                        <div class="camera_caption moveFromLeft">
                            <h2>Easy to use in any Mobile Device</h2>
                            <p>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                            <div class="button">
                              <a href="cart.html">View Cart</a>
                              <a href="checkout.html">Checkout</a>
                            </div>
                        </div>
                    </div>
                    </div><!-- #camera_wrap_1 -->
                    <div style="clear:both; display:block; height:40px"></div>
                </div><!--end:featured-->
               
                <div id="intro">
                	<div class="one-fourth serv first">
                    	<img src="../../Content/images/service-1.png" alt="">
                        <h3><a href="#">Free Shipping</a></h3>
                        <span>Available</span>
                    </div>
                    <div class="one-fourth serv">
                    	<img src="../../Content/images/service-2.png" alt="">
                        <h3><a href="#">30 Days Return</a></h3>
                        <span>Easy Return</span>
                    </div>
                    <div class="one-fourth serv">
                    	<img src="../../Content/images/service-3.png" alt="">
                        <h3><a href="#">Call Us</a></h3>
                        <span>(63) 912 3456</span>
                    </div>
                    <div class="one-fourth serv">
                    	<img src="../../Content/images/service-4.png" alt="">
                        <h3><a href="#">Secured</a></h3>
                        <span>Checkout</span>
                    </div>
                </div>

            <div class="container-2">
                @if (Model.Count > 0)
                {
                    <section class="content">
                        <ul id="products" class="grid clearfix">
                        	
                    @foreach (var item in Model)
                    {
                        // @Html.Partial("_SingleDealView",item)
                        <li class="da-thumbs">
    <div class="product-thumb-hover">
        <section class="left">
            <img src="@Url.Content("~/Content/images/products/product-1.jpg")" style="width:279px; height:290px" alt="">
            <p class="sale">Hot</p>
            <article class="da-animate da-slideFromRight" style="display: block; width: 280px">
                <h3 style="margin-top: 8px; margin-left: 15px; float: left">@item.SoLuongBan Số Lần Mua</h3>
                <div id="@item.MaDeal" style="height: 50px" class="count-element" year="@item.NgayHetHan.Value.Date.ToString("yyyy")" month="@item.NgayHetHan.Value.Date.ToString("MM")" date="@item.NgayHetHan.Value.Date.ToString("dd")"></div>
                @*<p><a href="product-detail.html" class="link tip" title="View Detail"></a>&nbsp;
                                            <a href="cart.html" class="cart tip" title="Add to cart"></a>&nbsp;&nbsp;
                                            <a href="../../Content/images/preview/work_1_l.jpg" rel="prettyPhoto[gallery1]" class="zoom tip" title="Zoom" ></a></p>*@
            </article>
        </section>
    </div>
    <section class="center">
        <h4><a href="@Url.Action("DetailDeal","Deal", new { ShortUrl = @item.URLRutGon })" class="current" style="border-right: 2px #fff">@item.TenDeal</a></h4>
    </section>
    <section class="right">
        <span class="price"><small>$ @item.GiaGoc</small>&nbsp;&nbsp; $@item.GiaGiam</span>
        <ul class="menu-button">
            <li><a href="cart.html" class="cart tip" title="Add to Cart"></a></li>
            <li><a href="@Url.Content("~/Content/images/preview/work_1_l.jpg")" rel="prettyPhoto[gallery1]" class="zoom tip" title="Zoom"></a></li>
            <li><a href="wishlist.html" class="wishlist tip" title="Add to Wishlist"></a></li>
            <li><a href="compare.html" class="compare tip" title="Compare"></a></li>
            <li><a href="product-detail.html" class="link tip" title="View Detail"></a></li>
        </ul>
    </section>
</li>
                    }

                            
                        </ul><!--end:products-->
                        <ul id="pagination">
                           @* <li><a class="current" href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">next</a></li>*@
                            @Html.Raw(@ViewBag.PagingView)
                        </ul>
                    </section>
                }
                	

            </div><!--end:container-2-->
              



            </div><!--end:content-wrap-->
 <script type="text/javascript">
        $("window").load(function() {
  $("#body").removeClass("preload");
});

		$(".share-btn").mouseenter(function() {
			setTimeout(function() {
			$(".item-menu").addClass("visible")
			}, 500);
		});
		$(".share-btn").mouseleave(function() {
			setTimeout(function() {
			$(".item-menu").removeClass("visible")
			}, 500);
		});
		$(".item-menu").hover(function() {
			$(".item-menu").addClass("visible")
		});
		$(".item-menu").mouseleave(function() {
			setTimeout(function() {
			$(".item-menu").removeClass("visible")
			}, 500);
		});
		$(".container-item").hover(function() {
			setTimeout(function() {
			$(".container-item").css("z-index","9000")
			}, 500);
		});
		
		$('.count-element').each(function (i, obj) {
		    
		    var year = $(this).attr("year");
		    var month = $(this).attr("month");
		    var date = $(this).attr("date");
		    var endDate = new Date();
		    endDate = new Date(year, month - 1, date);
		    var id = $(this).attr("id");
		    $('#' + id).countdown({ until: endDate });
		    

		});
		
		//$('#year').text(austDay.getFullYear());
    </script>